package com.shopping.user;

import com.shopping.orm.User;
import com.shopping.orm.UserDao;

public class UserManagerImpl implements UserManager {
	
	private UserDao userDao;
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	
	public int addUser(String username,String pass,String email) throws Exception {
		try{
		
			User u = new User();
			u.setName(username);
			u.setEmail(email);
			u.setSex(pass);
			userDao.save(u);
			return 1;
		}catch(Exception e){
			e.printStackTrace();
			throw new Exception("error");
			
		}
		
	}


}
